<template>
	<view class="">
	<!-- 	<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/bind')">
			<view>修改手机号</view>
			<view><u-icon name="arrow-right"></u-icon></view>
		</view> -->
		<!-- <view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/feedbackIndex/feedbackIndex')">
			<view>帮助中心</view>
			<view><u-icon name="arrow-right"></u-icon></view>
		</view>
		<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/feedback/index')">
			<view>意见反馈</view>
			<view><u-icon name="arrow-right"></u-icon></view>
		</view> -->
		<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/xieyi')">
			<view>用户协议</view>
			<view><u-icon name="arrow-right"></u-icon></view>
		</view>
		<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/mimi')">
			<view>隐私协议</view>
			<view><u-icon name="arrow-right"></u-icon></view>
		</view>
		<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/logOff')">
			<view>注销账号</view>
			<view><u-icon name="arrow-right"></u-icon></view>
		</view>
	<!-- 	<view class="flex justify-between padding bg-white solid-bottom" @click="loginOut">
			<view>退出登录</view>
			<view><u-icon name="arrow-right"></u-icon></view>
		</view> -->
		
	<!-- 	<view style="margin: 10rpx auto;">
					<button
					  open-type="im"
					  :data-im-id="imId"
					  @im="imCallback"
					  @error="onimError"
					  style="
						height: 33px;
						background-color: #5173F8;
						color: #FFFFFF;
						font-size: 14px;
						margin:10px"
					>
					  联系客服 9:00~22:00
					</button>
			</view> -->
			<view style="margin: 10rpx auto;margin: 5px auto;position: fixed;bottom: 10%;right: 0;">
						<button
						  open-type="im"
						  :data-im-id="imId"
						  @im="imCallback"
						  @error="onimError"
						  style="
							background-color: rgb(94 97 109 / 57%);
							color: #FFFFFF;
							font-size: 12px;
							height: 60px;
							width: 75px;
							padding: 0;
							border-radius: 0;
							border-top-left-radius: 15px;
							border-bottom-left-radius: 15px;"
							
						>
						<view class="">
							<u-icon name="server-man" color="#fff" size="28"> </u-icon>
							<text style="margin: 0 5px;">客服</text>
						</view>
						
						  <text style="display: block;font-size: 9px;">9:00~22:00</text>
						</button>
				</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imId:'chiguakefu'
			}
		},
		onLoad() {
			
		},
		methods: {
			imCallback(e) {
			  console.log("跳转IM客服成功", e.detail);
			},
			onimError(e) {
							  console.log(this.imId)
			  console.log("拉起IM客服失败", e.detail);
			},
			
			goNav(e) {
				uni.navigateTo({
					url: e
				})
			},
			// 退出登录
			loginOut() {
				uni.showModal({
					title: '退出提醒',
					content: '确定要退出登录么',
					success: e => {
						if (e.confirm) {
							this.avatar = '../../static/images/me/head.png';
							this.userName = '';
							// this.isLogin = false
							// 清除本地数据
							uni.removeStorageSync('token')
							uni.removeStorageSync('userName')
							uni.removeStorageSync('avatar')
							uni.removeStorageSync('phone')
							uni.removeStorageSync('invitationCode')
							uni.removeStorageSync('sex')
							uni.removeStorageSync('userId')
							// uni.removeStorageSync('openId')
							uni.removeStorageSync('zhiFuBao')
							uni.removeStorageSync('zhiFuBaoName')
							uni.removeStorageSync('isVIP')
							uni.showToast({
								icon:'none',
								title:'退出登录成功'
							})
							setTimeout(function(){
								uni.navigateBack()
							},1500)
						}
					}
				});
			}
		}
		
	}
</script>

<style>
</style>
